<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<title>页面类型 -- Powered by CentIMS {$core_version}</title>
		<link href="{'bootstrap/css/bootstrap.css'|shared}" rel="stylesheet"/>
		<link href="{'bootstrap/css/bootstrap-responsive.css'|shared}" rel="stylesheet"/>
		<link href="{'plugins/ztree/ztree.css'|jquery}" rel="stylesheet"/>
		<link href="{'common.css'|shared}" rel="stylesheet"/>		
	</head>
	<body>
		<div class="workspace">
			<ul class="nav nav-tabs">
				<li>&nbsp;&nbsp;</li>	
			    <li><a href=".">主题列表</a></li>
			    <li><a href="./?Ctlr=PageType">页面类型</a></li>
			    <li class="active"><a href="#">{if $editing}编辑{else}新增{/if}类型</a></li>
		    </ul>
		    {if $page_tip_info}
		    <div class="alert {$alert_cls}">
		        <button class="close" data-dismiss="alert">×</button>
		        {$page_tip_info}
	      	</div>
	      	{/if}		    	        
		</div>
		<div>
			<form class="form-horizontal" id="type-form" method="POST" action="./?Ctlr=SaveType">
				<input type="hidden" name="page_type_id" id="page_type_id" value="{$page_type_id}"/>
		       	<fieldset>          		
		       		<div class="control-group {$error_cls.page_type}">
		         		<label class="control-label" for="page_type">页面类型</label>
		            	<div class="controls">
		              		<input type="text" id="page_type" name="page_type" value="{$page_type}">
		              		<span class="help-inline">{$error.page_type}</span>
		            	</div>
		          	</div>          
		          		
		          	<div class="control-group {$error_cls.page_type_name}">
		            	<label class="control-label" for="page_type_name">页面类型名称</label>
		            	<div class="controls">
		             		<input type="text" id="page_type_name" name="page_type_name" value="{$page_type_name}">
		              		<span class="help-inline">{$error.page_type_name}</span>
		            	</div>
		          	</div>
		          	<div class="control-group">
		            	<label class="control-label" for="default_template">默认模板</label>
		            	<div class="controls">
		            		<div class="input-append">
		             			<input class="span3 disabled" readonly="readonly" type="text" id="default_template" name="default_template" value="{$default_template}"><button id="btn-select-tpl" class="btn" type="button">选择..</button>	              		
		            		</div>
		            	</div>
		          	</div>
		          	<div class="control-group">
		            	<label class="control-label" for="note">备注</label>
		            	<div class="controls">
		             		<textarea class="input-xlarge" name="note" id="note" rows="3">{$note}</textarea>
		            	</div>
		          	</div>      		
			        <div class="form-actions">
			            <button type="submit" class="btn btn-primary">保存</button>
			            {if $editing != 1}
			            <button type="submit" name="goon" value="1" class="btn btn-primary">新增并继续</button>
			            {/if}		            	
			            <a href="./" class="btn">取消</a>
			        </div>
		        </fieldset>
		    </form>
		</div>
		
		
		<div class="modal hide" id="tpl-selector">
		  	<div class="modal-header">
			    <button class="close" data-dismiss="modal">×</button>
			    <h3>选择模板</h3>
		  	</div>
		  	
			<div class="modal-body" style="height:250px;overflow:auto;">
				<ul class="ztree" id="tpls-tree"></ul>
			</div>
						  
			<div class="modal-footer">
				<span id="tpl-info" class="label label-warning" style="margin-right:15px;display:none;">请选择模板!</span>
				<a href="#" class="btn" id="btn-close-form">关闭</a>
				<a href="#" class="btn btn-primary" id="btn-done">确定</a>
			</div>
		</div>
		
		<script type="text/javascript" src="{'jquery-1.7.1.js'|jquery}"></script>
		<script type="text/javascript" src="{'bootstrap/bootstrap.js'|shared}"></script>
		<script type="text/javascript" src="{'common.js'|shared}"></script>
		<script type="text/javascript" src="{'plugins/jquery.validate.js'|jquery}"></script>
		<script type="text/javascript" src="{'plugins/ztree/ztree.js'|jquery}"></script>
		<script type="text/javascript">			
			var tplNodes = {$nodes};
		</script>		
		<script type="text/javascript" src="page_type.js"></script>
	</body>
</html>